<div class="titlebar">
    <div class="fn-left"><i class="iconfont icon-text_icon"></i>优惠券列表</div>
    <div class="fn-right ">
        <form id="form" action="{:url('coupon.index/select')}" method="get" class="input-group">
            <input type="hidden" name="input" value="{$input}"/>
            <input type="hidden" name="store_id" value="{$store_id}"/>
            <input placeholder="请输入优惠券名称" class="input" type="text" name="keyword" value="{$keyword}"/>
            <input type="submit" value="搜索" class="button button-blue" />
        </form>
    </div>
</div>
<table class="table table-border">
    <thead>
        <tr>
            <th class="w100 fn-tac">选择</th>
            <th>优惠券信息</th>
            <th class="w100 fn-tac">状态</th>
            <th class="w100 fn-tar">满多少用(￥)</th>
            <th class="w100 fn-tar">优惠/金额</th>
            <th class="w120 fn-tac">更新日期</th>
        </tr>
    </thead>
    <tbody>
        {foreach $lists as $vo}
        <tr>
            <td class="fn-tac"><a href="javascript:;" class="button selectID" title="选择" data-id="{$vo.id}"><i class="iconfont icon-text_icon"></i>选择</a></td>
            <td>
                <p class="chickWin fn-cp" url="{:url('coupon.index/review',['id'=>$vo.id])}">
                    <i class="iconfont icon-discount"></i><span class="fn-fb">{$vo.name}</span><br />
                    <span class="gray"><i class="iconfont icon-wodedingdan2"></i>{$vo.tips}</span>
                </p>
            </td>            
            <td class="fn-tac"><span class="badge {switch $vo.types}{case 1}bg-green{/case}{case 2}bg-red{/case}{default /}bg-blue{/switch}">{$vo.typesname}</span></td>
            <td class="fn-tar"><i class="iconfont icon-renminbi1688"></i>{$vo.howmuch|money}</td>
            <td class="fn-tar">{if $vo.types == 1}{$vo.discount}折{else}￥{$vo.price}{/if}</td>
            <td class="fn-tac">{$vo.update_time|date="Y-m-d"}</td>
        </tr>
        {/foreach}
    </tbody>
</table>
{$lists|raw}
<script type="text/javascript">
Do('base','layer',function(){
    $(".chickWin").win();
    var index = parent.layer.getFrameIndex(window.name);
    $('.selectID').click(function(){
        var member_id = $(this).attr('data-id');
        parent.$("#"+$('body').attr("class")).contents().find("#{$input}").val(member_id);  
        parent.layer.close(index); 
    });
})
</script>